package com.dmz.workflow.constant;

public enum ProcessStatusEnum {

    /**
     * 流程状态：0 待审核，1:通过，2:拒绝 3:撤销
     */
    PROCESS_APPROVING(0, "审批中","#EEE685"),
    PROCESS_APPROVED(1, "已通过","#7CFC00"),
    PROCESS_REFUSE(2, "已拒绝","#CD0000"),
    PROCESS_REPEAL(3, "已撤销","#ABABAB");

    Integer status;
    String desc;
    String color;

    ProcessStatusEnum(Integer status, String desc,String color) {
        this.status = status;
        this.desc = desc;
        this.color = color;
    }

    public static String getDesc(Integer status){
        ProcessStatusEnum[] values = ProcessStatusEnum.values();
        for (ProcessStatusEnum value : values) {
            if (value.status.equals(status)){
                return value.desc;
            }
        }
        return null;
    }

    public static String getColor(Integer status){
        ProcessStatusEnum[] values = ProcessStatusEnum.values();
        for (ProcessStatusEnum value : values) {
            if (value.status.equals(status)){
                return value.color;
            }
        }
        return null;
    }
}
